#ifndef JLIB_GRAPHICS_MANAGERS_SHADERMANAGER_H
#define JLIB_GRAPHICS_MANAGERS_SHADERMANAGER_H

#include "../opengl/shader.h"
#include <unordered_map>

namespace jlib {


struct ShaderManager : public Object {

  inline bool init () noexcept { return true; }

  Shader *get (const std::string &name) noexcept;
  Shader *get (const std::string &name, const char *vs, const char *fs, const char *gs = nullptr) noexcept;

  void clear () noexcept;

private:
  std::unordered_map<std::string, Objptr<Shader> > _cache;

}; // struct ShaderManager


} // namespace jlib

#endif // JLIB_GRAPHICS_MANAGERS_SHADERMANAGER_H
